<route lang="json5" type="page">
{
  layout: 'default',
  style: {
    navigationBarTitleText: '通知',
  },
}
</route>

<template>
  <Loading v-if="loading"></Loading>
  <view v-else class="bg-gray-100 h-lvh p-4">
    <view v-for="notice in data.records" :key="notice.id">
      <CardComp :notice="notice" ></CardComp>
    </view>
    
  </view>
</template>

<script lang="ts" setup>
import Loading from '@/components/loading/loading.vue'
import useRequest from '@/hooks/useRequest'
import { getNoticeAPI, Response } from '@/service/notice/notice'
import CardComp from './components/card.vue'

const {
  loading: loading,
  error: err,
  data: data,
  run: getNotice,
} = useRequest<Response>(() => getNoticeAPI())
onMounted(() => {
  getNotice()
})
</script>

<style lang="scss" scoped>
//
</style>
